OTSndReply
You use theOTSndReply
function to reply to a connection-oriented transaction-
based request.C INTERFACE
OSStatus OTSndReply (EndpointRef ref, TReply* reply, OTFlags* replyFlags);C++ INTERFACE
OSStatus TEndpoint::SndReply(TReply* reply, OTFlags flags);PARAMETERS
ref
- The endpoint reference of the endpoint reading the request.
reply
- A pointer to a
TReply
structure (page 3-67) that specifies the reply data being sent, the transaction ID for this transaction, and any options you want to set.replyFlags
- A bitmapped long specifying whether the rest of the reply is being sent with a subsequent call to this function (
T_MORE
) or whether this is the complete reply (T_MORE
not set).DESCRIPTION
You use theOTSndReply
function to reply to a request you have read using theOTRcvRequest
function. Thereply
parameter contains the reply to be sent, and thereplyFlags
parameter specifies whether you are sending the entire reply with this send (T_MORE
bit clear) or sending just part of the reply (T_MORE
bit set). If you are using multiple sends to send the reply, you must set theT_MORE
bit on each but the last send. The total size of the data you send using multiple sends must not exceed the value of thetsdu
field of theTEndpointInfo
structure for this endpoint.If the endpoint is in blocking mode, the
OTSndReply
function returns after it has sent the reply. If the endpoint is in nonblocking mode, theOTSndReply
function returns thekOTFlowErr
result if the endpoint provider is unable to send the reply because of flow-control restrictions. The provider issues theT_GODATA
event when these restrictions are lifted. You can use theOTLook
function to poll for this event, or you can use your notifier to handle it.If the endpoint is in asynchronous mode, the provider calls your notifier when the
OTSndReply
function completes. Thecode
parameter of the notifier function contains theT_REPLYCOMPLETE
event, thecookie
parameter contains thereply
parameter passed with theOTSndReply
function, and theresult
parameter contains the function result.The next table shows how the endpoint's mode of execution and blocking status affects the behavior of the
OTSndReply
function.
Blocking Nonblocking Synchronous The function returns when the provider lifts flow-control restrictions and the reply has been successfully sent or timed out. The function returns if flow-
control restrictions are in effect or when the reply has been successfully sent or timed out.The kOTFlowErr
result is never returned.The kOTFlowErr
result might be returned.Asynchronous The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETE
for thecode
parameter when the reply is successfully sent or timed out.The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETE
for thecode
parameter when the reply is successfully sent or timed out.The kOTFlowErr
result is never returned.The kOTFlowErr
result might be returned.VALID STATES
T_DATAXFER
,T_OUTREL
COMPLETION EVENTS
T_REPLYCOMPLETE
0x20000004 The OTSndReply
function has completed. Thecookie
parameter of the notifier function points to thereply
parameter.SEE ALSO
You use theOTRcvRequest
function (page 3-139) to read an incoming request before calling theOTSndReply
function to reply to the request.You use the
TReply
structure (page 3-67) to specify the reply data being sent, the transaction ID for this transaction, and any options you want to set.The peer endpoint calls the
OTRcvReply
function (page 3-144) to acknowledge receiving the reply you send using theOTSndReply
function.You use the
OTData
structure (page 3-52) to transfer noncontiguous data.